package processos.banco;

import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

import primeiraConexao.Conexao;

public class CriaConexao 
{
	public static Connection getConexao() throws SQLException, IOException {
        try {
        	Properties param = new Properties();
            param.load(Conexao.class.getResourceAsStream("banco.properties"));
            Class.forName("com.mysql.jdbc.Driver");
            
			String login="root";
			String senha = "102660";
            return DriverManager.getConnection( new Properties().getProperty("url"),login,senha);
           // param.load(Conexao.class.getResourceAsStream("banco.properties"));param.getProperty("url");//"jdbc:mysql://localhost/db_farmacia", "root", "102660");
        } catch (ClassNotFoundException e) {
            throw new SQLException(e.getMessage());
        }
    }

}
